package top.hudk.math;

import java.math.BigDecimal;
import java.math.RoundingMode;

public class BigDecimalTest {


    public void test1(){
        Double d1 = 2.3335D;
        Double d2 = 0.6359D;
        BigDecimal bigDecimal1 = new BigDecimal(Double.toString(d1)).setScale(2, RoundingMode.HALF_DOWN);
        BigDecimal bigDecimal2 = new BigDecimal(Double.toString(d2)).setScale(2, RoundingMode.HALF_DOWN);
        System.out.println(bigDecimal1);
        System.out.println(bigDecimal2);
    }
}
